package com.problem.leetcode;

/**
 * @author yanzhuoleo
 * @version V1.0
 * @Description: Problem58
 * @date 2018-01-06-下午10:37
 */

public class Problem58 {
    public int lengthOfLastWord(String s) {
        s = s.trim();
        String[] strs = s.split(" ");
        if(strs ==null || strs.length <= 0) {
            return 0;
        }

        String value = strs[strs.length - 1];
        return value.length();

    }
}
